import 'package:flutter/material.dart';
import 'package:hi_flutter/app_page.dart';

class AnimatePage13 extends StatefulWidget {
  const AnimatePage13({Key? key}) : super(key: key);

  @override
  State<AnimatePage13> createState() => AnimatePage13State();
}

class AnimatePage13State extends State<AnimatePage13>
    with TickerProviderStateMixin {
  late AnimationController controller;
  late CurvedAnimation curve;

  @override
  void initState() {
    super.initState();
    controller = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 2000),
    );
    curve = CurvedAnimation(parent: controller, curve: Curves.easeIn);
  }

  @override
  Widget build(BuildContext context) {
    return AppPage(
      body: Center(
        child: FadeTransition(
          opacity: curve,
          child: const FlutterLogo(
            size: 100.0,
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        tooltip: 'Fade',
        onPressed: () {
          controller.forward();
        },
        child: const Icon(Icons.brush),
      ),
    );
  }
}
